﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YLW.Plat.Jhfw.HL7V3.XSDModels.POOR_IN200901UV_Yzxx;
using YLW.Plat.Jhfw.Model.JhfwYzbc;

namespace YLW.Plat.Jhfw.HL7V3.V3Message
{
    public class V3_POOR_IN200901UV_Yzxx
    {
        public static string OrderInfoAdd(AddJhfwYzbcIn jsonData, string id_extension, string sender_name, string receiver_name)
        {
            string hl7Xml = string.Empty;

            if (jsonData == null)
            {
                return hl7Xml;
            }

            //根据XML XSD构建HL7 XML消息格式

            //性别
            string sexCode = "";
            string sexName = "";
            switch (jsonData.psex)
            {
                case "B":
                    sexCode = "9";
                    sexName = "未说明的性别";
                    break;
                case "F":
                    sexCode = "2";
                    sexName = "女性";
                    break;
                case "M":
                    sexCode = "1";
                    sexName = "男性";
                    break;
                case "U":
                    sexCode = "0";
                    sexName = "未知的性别";
                    break;
            }

            //创建根对象
            var xmlRoot = new POOR_IN200901UV
            {
                ITSVersion = "XML_1.0",
                id = new id { root = "2.16.156.10011.2.5.1.1", extension = id_extension },
                creationTime = new creationTime { value = DateTime.Now.ToString("yyyyMMddHHmmss") },
                interactionId = new interactionId { root = "2.16.156.10011.2.5.1.2", extension = "POOR_IN200901UV" },
                processingCode = new processingCode { code = "P" },
                processingModeCode = new processingModeCode(),
                acceptAckCode = new acceptAckCode { code = "AL" },
                receiver = new receiver
                {
                    typeCode = "RCV",
                    device1 = new device1
                    {
                        classCode = "DEV",
                        determinerCode = "INSTANCE",
                        id = new id
                        {
                            item = new item[]
                            {
                                new item{
                                    root = "2.16.156.10011.2.5.1.3",
                                    extension = receiver_name
                                }
                            }
                        }
                    }
                },
                sender = new sender
                {
                    typeCode = "SND",
                    device1 = new device1
                    {
                        classCode = "DEV",
                        determinerCode = "INSTANCE",
                        id = new id
                        {
                            item = new item[]
                            {
                                new item
                                {
                                    root = "2.16.156.10011.2.5.1.3",
                                    extension = sender_name
                                }
                            }
                        }
                    }
                },
                controlActProcess = new controlActProcess
                {
                    classCode = "CACT",
                    moodCode = "EVN",
                    subject = new subject
                    {
                        typeCode = "SUBJ",
                        placerGroup = new placerGroup
                        {
                            classCode = "GROUPER",
                            moodCode = "RQO",
                            author = new author
                            {
                                typeCode = "AUT",
                                contextControlCode = "OP",
                                time = new time
                                {
                                    value = jsonData.kdrq
                                },
                                signatureCode = new signatureCode
                                {
                                    code = "S"
                                },
                                signatureText = new signatureText
                                {
                                    value = jsonData.kdysxm
                                },
                                assignedEntity = new assignedEntity
                                {
                                    classCode = "ASSIGNED",
                                    id = new id
                                    {
                                        item = new item[]
                                        {
                                            new item{ root="2.16.156.10011.1.4", extension=jsonData.kdysdm }
                                        }
                                    },
                                    assignedPerson = new assignedPerson
                                    {
                                        classCode = "PSN",
                                        determinerCode = "INSTANCE",
                                        name = new name
                                        {
                                            item = new item
                                            {
                                                Items = new object[]
                                                {
                                                    new part
                                                    {
                                                        value=jsonData.kdysxm
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    representedOrganization = new representedOrganization
                                    {
                                        classCode = "ORG",
                                        determinerCode = "INSTANCE",
                                        id = new id
                                        {
                                            item = new item[]
                                            {
                                                new item
                                                {
                                                    root="2.16.156.10011.1.26",
                                                    extension=jsonData.kdksdm
                                                }
                                            }
                                        },
                                        name = new name
                                        {
                                            item = new item
                                            {
                                                Items = new object[]
                                                {
                                                    new part
                                                    {
                                                        value=jsonData.kdksmc
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            verifier = new verifier
                            {
                                typeCode = "VRF",
                                contextControlCode = "OP",
                                time = new time { value = jsonData.shrq },
                                signatureCode = new signatureCode
                                {
                                    code = "S"
                                },
                                signatureText = new signatureText
                                {
                                    value = jsonData.shrxm
                                },
                                assignedEntity = new assignedEntity
                                {
                                    classCode = "",
                                    id = new id
                                    {
                                        item = new item[]
                                        {
                                            new item
                                            {
                                                root="2.16.156.10011.1.4",
                                                extension=jsonData.shrdm
                                            }
                                        }
                                    },
                                    assignedPerson = new assignedPerson
                                    {
                                        classCode = "PSN",
                                        determinerCode = "INSTANCE",
                                        name = new name
                                        {
                                            item = new item
                                            {
                                                Items = new object[]
                                                {
                                                    new part
                                                    {
                                                        value=jsonData.shrxm
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            component2 = new component2
                            {
                                sequenceNumber = new sequenceNumber
                                {
                                    value = "1"
                                },
                                substanceAdministrationRequest = new substanceAdministrationRequest
                                {
                                    classCode = "SBADM",
                                    moodCode = "RQO",
                                    id = new id { root = "2.16.156.10011.1.28", extension = jsonData.yzlbdm },
                                    code = new code
                                    {
                                        code1 = "1",
                                        codeSystem = "2.16.156.10011.2.3.1.268",
                                        codeSystemName = "医嘱项目类型代码表",
                                        displayName = new displayName { value = jsonData.yzlbmc }
                                    },
                                    text = new text(),
                                    statusCode = new statusCode
                                    {
                                        code = "active"
                                    },
                                    effectiveTime = new effectiveTime
                                    {
                                        validTimeLow = jsonData.kssj,
                                        validTimeHigh = jsonData.jssj,
                                        code = new code
                                        {
                                            code1 = jsonData.pddm,
                                            codeSystem = "2.16.156.10011.2.5.1.13",
                                            codeSystemName = "药物使用频次代码表",
                                            displayName = new displayName
                                            {
                                                value = jsonData.pdmc
                                            }
                                        }
                                    },
                                    routeCode = new routeCode
                                    {
                                        code = jsonData.yytjdm,
                                        codeSystem = "2.16.156.10011.2.3.1.158",
                                        codeSystemName = "用药途径代码表",
                                        displayName = new displayName
                                        {
                                            value = jsonData.yytjmc
                                        }
                                    },
                                    doseQuantity = new doseQuantity
                                    {
                                        value = jsonData.dcjl,
                                        unit = jsonData.dcjldw,
                                    },
                                    doseCheckQuantity = new doseCheckQuantity
                                    {
                                        item = new item
                                        {
                                            Items = new object[]
                                            {
                                                new numerator{ unit="", value="" },
                                                new denominator{ unit="", value="" }
                                            }
                                        }
                                    },
                                    administrationUnitCode = new administrationUnitCode
                                    {
                                        code = jsonData.jxdm,
                                        codeSystem = "2.16.156.10011.2.3.1.211",
                                        codeSystemName = "药品剂型代码表",
                                        displayName = new displayName
                                        {
                                            value = jsonData.jxmc
                                        }
                                    },
                                    consumable2 = new consumable2
                                    {
                                        typeCode = "CSM",
                                        manufacturedProduct1 = new manufacturedProduct1
                                        {
                                            classCode = "MANU",
                                            id = new id { extension = "" },
                                            manufacturedProduct = new manufacturedProduct
                                            {
                                                classCode = "MMAT",
                                                determinerCode = "KIND",
                                                code = new code
                                                {
                                                    code1 = "",
                                                    codeSystem = "2.16.156.10011.2.5.1.14"
                                                },
                                                name = new name
                                                {
                                                    item = new item
                                                    {
                                                        Items = new object[]
                                                        {
                                                            new part
                                                            {
                                                                value = jsonData.ywmc
                                                            }
                                                        }
                                                    }
                                                },
                                                asContent = new asContent
                                                {
                                                    classCode = "CONT",
                                                    quantity = new quantity(),
                                                    containerPackagedProduct = new containerPackagedProduct
                                                    {
                                                        classCode = "HOLD",
                                                        determinerCode = "KIND",
                                                        code = new code(),
                                                        formCode = new formCode(),
                                                        capacityQuantity = new capacityQuantity
                                                        {
                                                            unit = "",
                                                            value = ""
                                                        }
                                                    }
                                                }
                                            },
                                            subjectOf3 = new subjectOf3
                                            {
                                                typeCode = "SBJ",
                                                policy = new policy
                                                {
                                                    classCode = "POLICY",
                                                    moodCode = "EVN",
                                                    code = new code
                                                    {
                                                        code1 = "",
                                                        displayName = new displayName { value = "" }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    location = new location
                                    {
                                        typeCode = "LOC",
                                        serviceDeliveryLocation = new serviceDeliveryLocation
                                        {
                                            classCode = "DSDLOC",
                                            location = new location
                                            {
                                                classCode = "PLC",
                                                determinerCode = "INSTANCE",
                                                Items = new object[]
                                                {
                                                    new id{
                                                        item=new item[]
                                                        {
                                                            new item{ root="2.16.156.10011.1.26", extension=jsonData.zxksdm }
                                                        }
                                                    },
                                                    new name
                                                    {
                                                        item=new item
                                                        {
                                                            Items=new object[]
                                                            {
                                                                new part
                                                                {
                                                                    value=jsonData.zxksmc
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    occurrenceOf = new occurrenceOf
                                    {
                                        parentRequestReference = new parentRequestReference
                                        {
                                            classCode = "GROUPER",
                                            id = new id { extension = jsonData.sjyzdm },
                                        }
                                    },
                                    pertinentInformation = new pertinentInformation
                                    {
                                        typeCode = "PERT",
                                        contextConductionInd = false,
                                        observation = new observation
                                        {
                                            classCode = "OBS",
                                            moodCode = "EVN",
                                            code = new code
                                            {
                                                code1 = "DE06.00.286.00",
                                                codeSystem = "2.16.156.10011.2.2.1",
                                                codeSystemName = "医嘱类别代码表"
                                            },
                                            value = new value
                                            {
                                                code = jsonData.yzlbdm,
                                                codeSystem = "2.16.156.10011.2.3.2.58",
                                                displayName = new displayName[]
                                                {
                                                    new displayName{ value=jsonData.yzlbmc }
                                                }
                                            }
                                        }
                                    },
                                    component2 = new component2
                                    {
                                        supplyRequest = new supplyRequest
                                        {
                                            classCode = "SPLY",
                                            moodCode = "RQO",
                                            id = new id(),
                                            code = new code(),
                                            statusCode = new statusCode { code = "active" },
                                            quantity = new quantity
                                            {
                                                unit = jsonData.lydw,
                                                value = jsonData.lyl
                                            },
                                            expectedUseTime = new expectedUseTime
                                            {
                                                validTimeLow = jsonData.ksjg,
                                                validTimeHigh = jsonData.jssj
                                            }
                                        }
                                    },
                                    subjectOf6 = new subjectOf6
                                    {
                                        typeCode = "SUBJ",
                                        contextConductionInd = false,
                                        seperatableInd = new seperatableInd { value = false },
                                        annotation = new annotation
                                        {
                                            text = new text
                                            {
                                                value = jsonData.remark
                                            },
                                            statusCode = new statusCode { code = "completed" },
                                            author = new author
                                            {
                                                assignedEntity = new assignedEntity
                                                {
                                                    classCode = "ASSIGNED"
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            componentOf1 = new componentOf1
                            {
                                contextConductionInd = false,
                                encounter = new encounter
                                {
                                    classCode = "ENC",
                                    moodCode = "EVN",
                                    id = new id
                                    {
                                        item = new item[]
                                        {
                                            new item
                                            {
                                                root="2.16.156.10011.2.5.1.8",
                                                extension=jsonData.series
                                            },
                                            new item
                                            {
                                                root="2.16.156.10011.2.5.1.9",
                                                extension=jsonData.jzlsh
                                            }
                                        }
                                    },
                                    code = new code
                                    {
                                        codeSystem = "2.16.156.10011.2.3.1.271",
                                        code1 = "",
                                        displayName = new displayName
                                        {
                                            value = jsonData.stay
                                        }
                                    },
                                    statusCode = new statusCode { code = "active" },
                                    subject = new subject
                                    {
                                        typeCode = "SUBJ",
                                        patient = new patient
                                        {
                                            classCode = "PAT",
                                            id = new id
                                            {
                                                item = new item[]
                                                {
                                                    new item
                                                    {
                                                        root="2.16.156.10011.2.5.1.5",
                                                        extension=""
                                                    },
                                                    new item
                                                    {
                                                        root="2.16.156.10011.2.5.1.4",
                                                        extension=jsonData.mrn
                                                    },
                                                    new item
                                                    {
                                                        root="2.16.156.10011.1.10",
                                                        extension=""
                                                    },
                                                    new item
                                                    {
                                                        root="2.16.156.10011.1.12",
                                                        extension=""
                                                    }
                                                }
                                            },
                                            telecom = new telecom
                                            {
                                                item = new item
                                                {
                                                    value = jsonData.pphone
                                                }
                                            },
                                            statusCode = new statusCode { code = "active" },
                                            patientPerson = new patientPerson
                                            {
                                                classCode = "PSN",
                                                determinerCode = "INSTANCE",
                                                id = new id
                                                {
                                                    item = new item[]
                                                    {
                                                        new item                                                         {
                                                            root="2.16.156.10011.1.3",
                                                            extension=jsonData.pcid
                                                        }
                                                    }
                                                },
                                                name = new name
                                                {
                                                    item = new item
                                                    {
                                                        Items = new object[]
                                                        {
                                                            new part
                                                            {
                                                                value=jsonData.pname
                                                            }
                                                        }
                                                    }
                                                },
                                                administrativeGenderCode = new administrativeGenderCode
                                                {
                                                    code = sexCode,
                                                    codeSystem = "2.16.156.10011.2.3.3.4",
                                                    codeSystemName = "生理性别代码表（GB/T 2261.1）",
                                                    displayName = new displayName
                                                    {
                                                        value = sexName
                                                    }
                                                },
                                                birthTime = new birthTime { value = jsonData.pbirthday },
                                                asOtherIDs = new asOtherIDs
                                                {
                                                    classCode = "ROL",
                                                    id = new id
                                                    {
                                                        item = new item[]
                                                        {
                                                            new item
                                                            {
                                                                root="2.16.156.10011.1.2",
                                                                extension=jsonData.dabh
                                                            },
                                                            new item
                                                            {
                                                                root="2.16.156.10011.1.19",
                                                                extension=jsonData.jkkh
                                                            }
                                                        }
                                                    },
                                                    scopingOrganization = new scopingOrganization
                                                    {
                                                        classCode = "ORG",
                                                        determinerCode = "INSTANCE"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    location = new location
                                    {
                                        typeCode = "LOC",
                                        time = new time(),
                                        serviceDeliveryLocation = new serviceDeliveryLocation
                                        {
                                            classCode = "SDLOC",
                                            location = new location
                                            {
                                                classCode = "PLC",
                                                determinerCode = "INSTANCE",
                                                Items = new object[]
                                                {
                                                    new id{
                                                        item = new item[]
                                                        {
                                                            new item
                                                            {
                                                                root="2.16.156.10011.1.22",
                                                                extension=jsonData.bedid
                                                            }
                                                        }
                                                    },
                                                    new name{
                                                        item=new item{
                                                            Items=new object[]
                                                            {
                                                                new part
                                                                {
                                                                    value=""
                                                                }
                                                            }
                                                        }
                                                    },
                                                    new asLocatedEntityPartOf
                                                    {
                                                        classCode = "LOCE",
                                                        location=new location
                                                        {
                                                            classCode="PLC",
                                                            determinerCode="INSTANCE",
                                                            Items=new object[]
                                                            {
                                                                new id
                                                                {
                                                                    item=new item[]
                                                                    {
                                                                        new item
                                                                        {
                                                                            root="2.16.156.10011.1.21",
                                                                            extension=jsonData.bfh
                                                                        }
                                                                    }
                                                                },
                                                                new name
                                                                {
                                                                    item=new item
                                                                    {
                                                                        Items=new object[]
                                                                        {
                                                                            new part
                                                                            {
                                                                                value=""
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            },
                                            serviceProviderOrganization = new serviceProviderOrganization
                                            {
                                                classCode = "ORG",
                                                determinerCode = "INSTANCE",
                                                id = new id
                                                {
                                                    item = new item[]
                                                    {
                                                        new item
                                                        {
                                                            root="2.16.156.10011.1.26",
                                                            extension=jsonData.zyksdm
                                                        }
                                                    }
                                                },
                                                name = new name
                                                {
                                                    item = new item
                                                    {
                                                        Items = new object[]
                                                        {
                                                            new part
                                                            {
                                                                value=jsonData.zyksmc
                                                            }
                                                        }
                                                    }
                                                },
                                                asOrganizationPartOf = new asOrganizationPartOf
                                                {
                                                    classCode = "PART",
                                                    wholeOrganization = new wholeOrganization
                                                    {
                                                        classCode = "ORG",
                                                        determinerCode = "INSTANCE",
                                                        id = new id
                                                        {
                                                            item = new item[]
                                                            {
                                                                new item
                                                                {
                                                                    root="2.16.156.10011.1.21",
                                                                    extension=jsonData.zybqdm
                                                                }
                                                            }
                                                        },
                                                        name = new name
                                                        {
                                                            item = new item
                                                            {
                                                                Items = new object[]
                                                                {
                                                                    new part
                                                                    {
                                                                        value=jsonData.zybqmc
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            extension = new extension
                            {
                                dotype = new dotype { value = new value { Text = new string[] { jsonData.dotype } } },
                                bedid = new bedid { value = new value { Text = new string[] { jsonData.bedid } } },
                                bfh = new bfh { value = new value { Text = new string[] { jsonData.bfh } } },
                                dabh = new dabh { value = new value { Text = new string[] { jsonData.dabh } } },
                                dcjl = new dcjl { value = new value { Text = new string[] { jsonData.dcjl } } },
                                dcjldw = new dcjldw { value = new value { Text = new string[] { jsonData.dcjldw } } },
                                ggdw = new ggdw { value = new value { Text = new string[] { jsonData.ggdw } } },
                                hoscode = new hoscode { value = new value { Text = new string[] { jsonData.hoscode } } },
                                jkkh = new jkkh { value = new value { Text = new string[] { jsonData.jkkh } } },
                                jssj = new jssj { value = new value { Text = new string[] { jsonData.jssj } } },
                                jxdm = new jxdm { value = new value { Text = new string[] { jsonData.jxdm } } },
                                jxmc = new jxmc { value = new value { Text = new string[] { jsonData.jxmc } } },
                                jzlsh = new jzlsh { value = new value { Text = new string[] { jsonData.jzlsh } } },
                                kdksdm = new kdksdm { value = new value { Text = new string[] { jsonData.kdksdm } } },
                                kdksmc = new kdksmc { value = new value { Text = new string[] { jsonData.kdksmc } } },
                                kdrq = new kdrq { value = new value { Text = new string[] { jsonData.kdrq } } },
                                kdysdm = new kdysdm { value = new value { Text = new string[] { jsonData.kdysdm } } },
                                kdysxm = new kdysxm { value = new value { Text = new string[] { jsonData.kdysxm } } },
                                ksjg = new ksjg { value = new value { Text = new string[] { jsonData.ksjg } } },
                                kssj = new kssj { value = new value { Text = new string[] { jsonData.kssj } } },
                                lydw = new lydw { value = new value { Text = new string[] { jsonData.lydw } } },
                                lyl = new lyl { value = new value { Text = new string[] { jsonData.lyl } } },
                                lyxt = new lyxt { value = new value { Text = new string[] { jsonData.lyxt } } },
                                mrn = new mrn { value = new value { Text = new string[] { jsonData.mrn } } },
                                patid = new patid { value = new value { Text = new string[] { jsonData.patid } } },
                                pbirthday = new pbirthday { value = new value { Text = new string[] { jsonData.pbirthday } } },
                                pcid = new pcid { value = new value { Text = new string[] { jsonData.pcid } } },
                                pddm = new pddm { value = new value { Text = new string[] { jsonData.pddm } } },
                                pdmc = new pdmc { value = new value { Text = new string[] { jsonData.pdmc } } },
                                pname = new pname { value = new value { Text = new string[] { jsonData.pname } } },
                                pphone = new pphone { value = new value { Text = new string[] { jsonData.pphone } } },
                                psex = new psex { value = new value { Text = new string[] { jsonData.psex } } },
                                remark = new remark { value = new value { Text = new string[] { jsonData.remark } } },
                                series = new series { value = new value { Text = new string[] { jsonData.series } } },
                                shrdm = new shrdm { value = new value { Text = new string[] { jsonData.shrdm } } },
                                shrq = new shrq { value = new value { Text = new string[] { jsonData.shrq } } },
                                shrxm = new shrxm { value = new value { Text = new string[] { jsonData.shrxm } } },
                                sjly = new sjly { value = new value { Text = new string[] { jsonData.sjly } } },
                                sjyzdm = new sjyzdm { value = new value { Text = new string[] { jsonData.sjyzdm } } },
                                stay = new stay { value = new value { Text = new string[] { jsonData.stay } } },
                                ybbm = new ybbm { value = new value { Text = new string[] { jsonData.ybbm } } },
                                ybmc = new ybmc { value = new value { Text = new string[] { jsonData.ybmc } } },
                                ypgg = new ypgg { value = new value { Text = new string[] { jsonData.ypgg } } },
                                ywmc = new ywmc { value = new value { Text = new string[] { jsonData.ywmc } } },
                                yytjdm = new yytjdm { value = new value { Text = new string[] { jsonData.yytjdm } } },
                                yytjmc = new yytjmc { value = new value { Text = new string[] { jsonData.yytjmc } } },
                                yyts = new yyts { value = new value { Text = new string[] { jsonData.yyts } } },
                                yzdm = new yzdm { value = new value { Text = new string[] { jsonData.yzdm } } },
                                yzid = new yzid { value = new value { Text = new string[] { jsonData.yzid } } },
                                yzlbdm = new yzlbdm { value = new value { Text = new string[] { jsonData.yzlbdm } } },
                                yzlbmc = new yzlbmc { value = new value { Text = new string[] { jsonData.yzlbmc } } },
                                yzmc = new yzmc { value = new value { Text = new string[] { jsonData.yzmc } } },
                                yzxh = new yzxh { value = new value { Text = new string[] { jsonData.yzxh } } },
                                zjl = new zjl { value = new value { Text = new string[] { jsonData.zjl } } },
                                zjldw = new zjldw { value = new value { Text = new string[] { jsonData.zjldw } } },
                                zxhoscode = new zxhoscode { value = new value { Text = new string[] { jsonData.zxhoscode } } },
                                zxksdm = new zxksdm { value = new value { Text = new string[] { jsonData.zxksdm } } },
                                zxksmc = new zxksmc { value = new value { Text = new string[] { jsonData.zxksmc } } },
                                zybqdm = new zybqdm { value = new value { Text = new string[] { jsonData.zybqdm } } },
                                zybqmc = new zybqmc { value = new value { Text = new string[] { jsonData.zybqmc } } },
                                zyksdm = new zyksdm { value = new value { Text = new string[] { jsonData.zyksdm } } },
                                zyksmc = new zyksmc { value = new value { Text = new string[] { jsonData.zyksmc } } },
                                useflag = new useflag { value = new value { Text = new string[] { jsonData.useflag } } },
                                in_date = new in_date { value = new value { Text = new string[] { jsonData.in_date } } },
                                in_empid = new in_empid { value = new value { Text = new string[] { jsonData.in_empid } } },
                                xgsj = new xgsj { value = new value { Text = new string[] { jsonData.xgsj } } },
                                xg_empid = new xg_empid { value = new value { Text = new string[] { jsonData.xg_empid } } }
                            }
                        }
                    }
                }
            };

            hl7Xml = HL7V3Helper.SerializeToXml(xmlRoot);

            return hl7Xml;
        }
    }
}
